#include <iostream>
#include <string>

#include <sw/redis++/redis++.h>

using std::cout;
using std::endl;
using std::string;

namespace redis = sw::redis;

int main(){
    // 连接 Redis 服务器的配置
    redis::ConnectionOptions connect_option;
    connect_option.host = "127.0.0.1";
    connect_option.port = 6379;
    connect_option.password = "666666";
    // url 也可以
    const string url = "tcp://666666@127.0.0.1:6379";

    // Redis 客户端对象
    redis::Redis redis(connect_option);

    // 测试连接
    cout << redis.ping() << endl;

    return 0;
}